package com.ewzj.bigdata.mvp.ui.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.widget.EditText;
import android.widget.TextView;

import com.ewzj.bigdata.R;
import com.ewzj.bigdata.app.constants.AppConstants;
import com.ewzj.bigdata.di.component.DaggerEditDetailComponent;
import com.ewzj.bigdata.di.module.EditDetailModule;
import com.ewzj.bigdata.mvp.contract.EditDetailContract;
import com.ewzj.bigdata.mvp.model.entity.resbean.UserBean;
import com.ewzj.bigdata.mvp.presenter.EditDetailPresenter;
import com.jess.arms.base.BaseActivity;
import com.jess.arms.di.component.AppComponent;
import com.jess.arms.utils.ArmsUtils;

import butterknife.BindView;
import butterknife.ButterKnife;

import static com.jess.arms.utils.Preconditions.checkNotNull;


public class EditDetailActivity extends BaseActivity<EditDetailPresenter> implements EditDetailContract.View {


    @BindView(R.id.toolbar_title)
    TextView toolbarTitle;
    @BindView(R.id.tv_confirm)
    TextView tvConfirm;
    @BindView(R.id.et_input)
    EditText etInput;

    @Override
    public void setupActivityComponent(AppComponent appComponent) {
        DaggerEditDetailComponent //如找不到该类,请编译一下项目
                .builder()
                .appComponent(appComponent)
                .editDetailModule(new EditDetailModule(this))
                .build()
                .inject(this);
    }

    @Override
    public int initView(Bundle savedInstanceState) {
        return R.layout.activity_editdetail; //如果你不需要框架帮你设置 setContentView(id) 需要自行设置,请返回 0
    }

    @Override
    public void initData(Bundle savedInstanceState) {
         String title=getIntent().getStringExtra(AppConstants.EXTRA_DATA_STRING);
         UserBean userBean=getIntent().getParcelableExtra(AppConstants.EXTRA_DATA);
        toolbarTitle.setText(title);
    }


    @Override
    public void showLoading() {

    }

    @Override
    public void hideLoading() {

    }

    @Override
    public void showMessage(@NonNull String message) {
        checkNotNull(message);
        ArmsUtils.snackbarText(message);
    }

    @Override
    public void launchActivity(@NonNull Intent intent) {
        checkNotNull(intent);
        ArmsUtils.startActivity(intent);
    }

    @Override
    public void killMyself() {
        finish();
    }


}
